From: Carlos Garnacho Date: Tue, 22 Jul 2014 10:27:05 +0000 (+0200) Subject: popupMenu: dismiss the menu on touch events X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2313 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=da26a9daf85209cc32f13f6f9664dfa95dbe9d6a;p=gnome-shell.git popupMenu: dismiss the menu on touch events No sequence checks are done, just any touch outside will dismiss the popup. https://bugzilla.gnome.org/show_bug.cgi?id=733633 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 36d7f845e..34986f733 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -106,6 +106,7 @@ const PopupBaseMenuItem = new Lang.Class({ if (this._activatable) { this.actor.connect('button-release-event', Lang.bind(this, this._onButtonReleaseEvent)); + this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent)); this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); } if (params.reactive && params.hover) @@ -132,6 +133,14 @@ const PopupBaseMenuItem = new Lang.Class({ return Clutter.EVENT_STOP; }, + _onTouchEvent: function (actor, event) { + if (event.type() == Clutter.EventType.TOUCH_END) { + this.activate(event); + return Clutter.EVENT_STOP; + } + return Clutter.EVENT_PROPAGATE; + }, + _onKeyPressEvent: function (actor, event) { let symbol = event.get_key_symbol();